﻿using CC.Data;
using CC.Entity; 

namespace CC.Business
{
    public class UserBLL
    {
        private readonly IRepository _repository = new Repository();
        public bool ExitLogin(int userId,int roleCode)
        {
             bool biUpdate = false;

            switch (roleCode)
            {
                case 1:
                case 2:
                    //从教务人员表中修改
                    biUpdate = _repository.UpadteLoginState<AdminInfo>(userId,false);
                    break;
                case 3:
                    //从教师表中修改
                    biUpdate = _repository.UpadteLoginState<TeacherInfo>(userId, false);
                    break;
                case 4:
                    biUpdate = _repository.UpadteLoginState<StudentInfo>(userId, false);
                    //从学生表中修改
                    break;
            } 
            return biUpdate;
        }

    }
}
